
<form name="editForm" role="form" novalidate ng-submit="vm.save()" show-validation>

    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"
                ng-click="vm.clear()">&times;</button>
        <h4 class="modal-title" id="myOperationLabel" data-translate="jhipsterSampleApplicationApp.operation.home.createOrEditLabel">Create or edit a Operation</h4>
    </div>
    <div class="modal-body">
        <jhi-alert-error></jhi-alert-error>
        <div class="form-group" ng-show="vm.operation.id">
            <label for="id" data-translate="global.field.id">ID</label>
            <input type="text" class="form-control" id="id" name="id"
                    ng-model="vm.operation.id" readonly />
        </div>
        <div class="form-group">
            <label class="control-label" data-translate="jhipsterSampleApplicationApp.operation.date" for="field_date">Date</label>
                <div class="input-group">
                    <input id="field_date" type="text" class="form-control" name="date" datetime-picker="{{dateformat}}" ng-model="vm.operation.date" is-open="vm.datePickerOpenStatus.date"
                    required  />
                    <span class="input-group-btn">
                        <button type="button" class="btn btn-default" ng-click="vm.openCalendar('date')"><i class="glyphicon glyphicon-calendar"></i></button>
                    </span>
                </div>
            <div ng-show="editForm.date.$invalid">
                <p class="help-block"
                    ng-show="editForm.date.$error.required" data-translate="entity.validation.required">
                    This field is required.
                </p>
                <p class="help-block"
                    ng-show="editForm.date.$error.ZonedDateTimelocal" data-translate="entity.validation.ZonedDateTimelocal">
                    This field should be a date and time.
                </p>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label" data-translate="jhipsterSampleApplicationApp.operation.description" for="field_description">Description</label>
            <input type="text" class="form-control" name="description" id="field_description"
                    ng-model="vm.operation.description"
                     />
        </div>
        <div class="form-group">
            <label class="control-label" data-translate="jhipsterSampleApplicationApp.operation.amount" for="field_amount">Amount</label>
            <input type="number" class="form-control" name="amount" id="field_amount"
                    ng-model="vm.operation.amount"
                    required />
            <div ng-show="editForm.amount.$invalid">
                <p class="help-block"
                    ng-show="editForm.amount.$error.required" data-translate="entity.validation.required">
                    This field is required.
                </p>
                <p class="help-block"
                    ng-show="editForm.amount.$error.number" data-translate="entity.validation.number">
                    This field should be a number.
                </p>
            </div>
        </div>

        <div class="form-group">
            <label data-translate="jhipsterSampleApplicationApp.operation.bankAccount" for="field_bankAccount">Bank Account</label>
            <select class="form-control" id="field_bankAccount" name="bankAccount" ng-model="vm.operation.bankAccount" ng-options="bankAccount as bankAccount.name for bankAccount in vm.bankaccounts track by bankAccount.id">
                <option value=""></option>
            </select>
        </div>
        <div class="form-group">
            <label data-translate="jhipsterSampleApplicationApp.operation.label" for="field_label">Label</label>
            <select class="form-control" id="field_label" multiple name="label" ng-model="vm.operation.labels" ng-options="label as label.label for label in vm.labels track by label.id"></select>
        </div>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="vm.clear()">
            <span class="glyphicon glyphicon-ban-circle"></span>&nbsp;<span data-translate="entity.action.cancel">Cancel</span>
        </button>
        <button type="submit" ng-disabled="editForm.$invalid || vm.isSaving" class="btn btn-primary">
            <span class="glyphicon glyphicon-save"></span>&nbsp;<span data-translate="entity.action.save">Save</span>
        </button>
    </div>
</form>
